import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Axios from "axios"
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// elementui自定义样式
import './assets/css/elementUICustom.css'
// 公共样式
import "./assets/css/base.css"
// avue
import Avue from '@smallwei/avue/lib/index.js'
import '@smallwei/avue/lib/theme-chalk/index.css'
//axios封装
import {postRequest, getRequest} from './assets/js/http.js'
Vue.prototype.postRequest = postRequest;
Vue.prototype.getRequest = getRequest;
// 时间转换方法
Vue.prototype.dateToString=function(date){ 
  var year = date.getFullYear(); 
  var month =(date.getMonth() + 1).toString(); 
  var day = (date.getDate()).toString();  
  if (month.length == 1) { 
      month = "0" + month; 
  } 
  if (day.length == 1) { 
      day = "0" + day; 
  }
  var dateTime = year + "-" + month + "-" + day;
  return dateTime; 
},
//消息提示
Vue.prototype.msgShow=function(data,refershFun){
  if(data.data[0]==0){
    this.$message({
    message: data.data[1],
    type: 'success'
});
    refershFun();
}else{
    this.$message.error("失败！请检查");
    this.$message.error(data.data[1]);
}
}

Axios.defaults.withCredentials=true;
Vue.use(ElementUI);
Vue.use(Avue);
Vue.prototype.$http = Axios;
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
